// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import FastClick from 'fastclick'
import App from './App'

import Vue from 'vue'
import VueRouter from 'vue-router'
import VueAwesomeSwiper from 'vue-awesome-swiper'
// for Vue 2.0
//import VueLazyload from 'vue-lazyload/vue-lazyload-next'
//import Home from './components/HelloFromVux'
//import VueResource from 'vue-resource'
import routes from './router/router.conf.js'
import store from './store'
let loading = require('./js/loading')();
let infiniteScroll =  require('vue-infinite-scroll');
Vue.use(infiniteScroll);
Vue.use(VueRouter);
Vue.use(VueAwesomeSwiper);
//Vue.use(VueLazyload, {
//  error: 'dist/error.png',
//  loading: 'dist/loading.gif',
//  try: 3 // default 1
//});

Vue.prototype.showLoading = function (str) {
      loading.show(str)
};
Vue.prototype.hideLoading = function (str) {
      loading.complete();
};
Vue.prototype.successLoading = function (str) {
      loading.success(str);
};
Vue.prototype.failLoading = function (str) {
      loading.fail(str);
};
const router = window.router = new VueRouter({
  routes
});

FastClick.attach(document.body)

/* eslint-disable no-new */
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
